package com.matou.commons.configure;


import com.matou.commons.handler.MaTouAccessDeniedHandler;
import com.matou.commons.handler.MaTouAuthExceptionEntryPoint;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * @Author CM
 * @Date 2021/5/9 9:46
 * @Description CmAuthExceptionConfigure
 * @Version 1.0
 */
public class MaTouAuthExceptionConfigure {
    @Bean
    @ConditionalOnMissingBean(name = "accessDeniedHandler")
    public MaTouAccessDeniedHandler accessDeniedHandler() {
        return new MaTouAccessDeniedHandler();
    }

    @Bean
    @ConditionalOnMissingBean(name = "authenticationEntryPoint")
    public MaTouAuthExceptionEntryPoint authenticationEntryPoint() {
        return new MaTouAuthExceptionEntryPoint();
    }
}
